using UnityEngine;

[ExecuteInEditMode]
public class PresetsRoller : MonoBehaviour
{
	public bool includeNuts;

	public float maxAngle;

	public bool yoyoLoop;

	public float rotationSpeed;

	public float startDelay;

	public bool isElliptical;

	private ControllerRoller controller;

	private void LateUpdate()
	{
		if (!Application.isEditor || Application.isPlaying)
		{
			return;
		}
		if (controller == null)
		{
			controller = base.gameObject.GetComponent<RemoteControl>().controller.GetComponent<ControllerRoller>();
			includeNuts = controller.includeNuts;
			isElliptical = controller.isElliptical;
			maxAngle = controller.maxAngle;
			yoyoLoop = controller.yoyoLoop;
			rotationSpeed = controller.rotationSpeed;
			startDelay = controller.startDelay;
		}
		if (controller != null)
		{
			controller.includeNuts = includeNuts;
			controller.maxAngle = maxAngle;
			controller.isElliptical = isElliptical;
			controller.yoyoLoop = yoyoLoop;
			controller.rotationSpeed = rotationSpeed;
			if (yoyoLoop)
			{
				controller.startDelay = startDelay;
			}
		}
	}
}
